<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>用户注册</title>
    <link rel="stylesheet" href="../css/register.css">
</head>
<body>

<div class="register-container">
    <h2>用户注册</h2>

    <form th:action="@{/register}" method="post">
        <div>
            <label for="username">用户名：</label>
            <input type="text" id="username" name="username" required/>
        </div>
        <div>
            <label for="password">密码：</label>
            <input type="password" id="password" name="password" required/>
        </div>

        <!-- 错误提示 -->
        <p th:if="${msg != null}" th:text="${msg}" class="error-message"></p>

        <button type="submit">注册</button>
    </form>

    <a th:href="@{/login}" class="link">已有账号？去登录</a>
</div>

</body>
</html>
